package com.dooioo.fangyou.web;

import com.dooioo.fangyou.entity.Estate;
import com.dooioo.fangyou.entity.Pet;
import com.dooioo.fangyou.service.EStateService;
import com.dooioo.fangyou.service.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * com.dooioo.fangyou.web
 * User: kqy
 * Date: 2010-11-30
 * Time: 16:00:50
 */

@Controller
@RequestMapping(value = "/list")
public class ListController {

    @Autowired
    private EStateService eStateService;

    @Autowired
    private PetService petService;
    
    @RequestMapping(method = RequestMethod.GET)
    public String list(Model model) {
        int[] test = {0, 1, 2, 3};
        model.addAttribute("test", test);

        Estate eState = (Estate)eStateService.findBy("eStateID", "0705280228170F80731BB15B0CD0BA49");
        Pet pet = (Pet)petService.findBy("id", "1");

        model.addAttribute(eState);
        model.addAttribute(pet);

        return "list";
    }
}
